import v2_12.Constants as Constants

from enum import Enum

class ClassId(Enum):
	def isTypedDataBaseClass(cid):
		return ClassId.TYPED_DATA_INT8_ARRAY.value <= cid < ClassId.BYTE_DATA_VIEW.value

	def isTypedDataViewClass(cid):
		return cid == ClassId.BYTE_DATA_VIEW.value or (ClassId.isTypedDataBaseClass(cid) and \
			((cid - ClassId.TYPED_DATA_INT8_ARRAY.value) % 3) == Constants.kTypedDataCidRemainderView)

	def isExternalTypedDataClass(cid):
		return ClassId.isTypedDataBaseClass(cid) and ((cid - ClassId.TYPED_DATA_INT8_ARRAY.value) % 3) == Constants.kTypedDataCidRemainderExternal

	def isTypedDataClass(cid):
		return ClassId.isTypedDataBaseClass(cid) and (cid - ClassId.TYPED_DATA_INT8_ARRAY.value) % 3 == Constants.kTypedDataCidRemainderInternal

	ILLEGAL = 0
	FREE_LIST_ELEMENT = 1
	FORWARDING_CORPSE = 2
	OBJECT = 3
	CLASS = 4
	PATCH_CLASS = 5
	FUNCTION = 6
	CLOSURE_DATA = 7
	FFI_TRAMPOLINE_DATA = 8
	FIELD = 9
	SCRIPT = 10
	LIBRARY = 11
	NAMESPACE = 12
	KERNEL_PROGRAM_INFO = 13
	CODE = 14
	INSTRUCTIONS = 15
	INSTRUCTIONS_SECTION = 16
	OBJECT_POOL = 17
	PC_DESCRIPTORS = 18
	CODE_SOURCE_MAP = 19
	COMPRESSED_STACK_MAPS = 20
	LOCAL_VAR_DESCRIPTORS = 21
	EXCEPTION_HANDLERS = 22
	CONTEXT = 23
	CONTEXT_SCOPE = 24
	SINGLE_TARGET_CACHE = 25
	UNLINKED_CALL = 26
	MONOMORPHIC_SMIABLE_CALL = 27
	CALL_SITE_DATA = 28
	IC_DATA = 29
	MEGAMORPHIC_CACHE = 30
	SUBTYPE_TEST_CACHE = 31
	LOADING_UNIT = 32
	ERROR = 33
	API_ERROR = 34
	LANGUAGE_ERROR = 35
	UNHANDLED_EXCEPTION = 36
	UNWIND_ERROR = 37
	INSTANCE = 38
	LIBRARY_PREFIX = 39
	TYPE_ARGUMENTS = 40
	ABSTRACT_TYPE = 41
	TYPE = 42
	FUNCTION_TYPE = 43
	TYPE_REF = 44
	TYPE_PARAMETER = 45
	CLOSURE = 46
	NUMBER = 47
	INTEGER = 48
	SMI = 49
	MINT = 50
	DOUBLE = 51
	BOOL = 52
	GROWABLE_OBJECT_ARRAY = 53
	FLOAT_32X4 = 54
	INT_32X4 = 55
	FLOAT_64X2 = 56
	TYPED_DATA_BASE = 57
	TYPED_DATA = 58
	EXTERNAL_TYPED_DATA = 59
	TYPED_DATA_VIEW = 60
	POINTER = 61
	DYNAMIC_LIBRARY = 62
	CAPABILITY = 63
	RECEIVE_PORT = 64
	SEND_PORT = 65
	STACK_TRACE = 66
	REG_EXP = 67
	WEAK_PROPERTY = 68
	MIRROR_REFERENCE = 69
	LINKED_HASH_MAP = 70
	FUTURE_OR = 71
	USER_TAG = 72
	TRANSFERABLE_TYPE_DATA = 73
	WEAK_SERIALIZATION_REFERENCE = 74
	ARRAY = 75
	IMMUTABLE_ARRAY = 76
	STRING = 77
	ONE_BYTE_STRING = 78
	TWO_BYTE_STRING = 79
	EXTERNAL_ONE_BYTE_STRING = 80
	EXTERNAL_TWO_BYTE_STRING = 81
	TYPED_DATA_INT8_ARRAY = 100
	BYTE_DATA_VIEW = 142
	BYTE_BUFFER = 143
	NULL = 144
	DYNAMIC = 145
	VOID = 146
	NEVER = 147
	NUM_PREDEFINED = 148